package com.lzm.back.mapper;


import com.lzm.back.entity.Score;
import com.lzm.back.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author Lenovo
 * @description 针对表【score(评分表)】的数据库操作Mapper
 * @createDate 2025-03-23 20:19:48
 * @Entity .domain.Score
 */
@Mapper
public interface ScoreMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Score record);

    int insertSelective(Score record);

    Score selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Score record);

    int updateByPrimaryKey(Score record);

    List<Score> selectScore(@Param("id") Integer id,
                            @Param("username") String username,
                            // 新增参数
                            @Param("role") String role,
                            @Param("userId") Integer userId);

    void deleteBatch(List<Integer> ids);

    List<Score> selectScoreGroupByEvent(@Param("id")Integer id, @Param("username")String username, @Param("role")String role,@Param("userId") Integer userId);

    Score selectMaxAndAvg(@Param("userId") Long userId,@Param("eventId") Long eventId);

    List<User> selectMaxScoreParticipant(@Param("eventId") Long eventId,@Param("score")  BigDecimal score);
}
